package com.xiguaji.tiktok.v1.tiktok.permission.repository;

import com.xiguaji.tiktok.v1.tiktok.permission.model.PermissionRecord;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;
@Repository
public interface PermissionRecordRepository extends CrudRepository<PermissionRecord,Long> {

    int countByPermissionLimitIdAndUserIdAndBelong(long permissionLimitId,long userId,int belong);

    int countByPermissionLimitIdAndUserIdAndBelongBetween(long permissionLimitId,long userId,int startDate,int endDate);

    Optional<PermissionRecord> findByPermissionLimitIdAndUserIdAndRecordDataAndBelong(long permissionLimitId,long userId,String recordData,int belong);

}
